<?php

defined('MYLITS') ? '' : exit('No direct script access allowed');

/**
 * @version     1.0.0
 * @package     mylits engine
 * @license     GNU General Public License version 3
 * @author      Arfan Fudyartanto D N <arfan@mylits.com> - http://engine.mylits.com
 */
class Mylits_Template {

    private static $instance;

    private function __construct() {
        
    }

    /**
     * This method will return Mylits_Template object
     * 
     * @return object Mylits_Template
     */
    public static function getInstance() {
        if (is_null(self::$instance)) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    /**
     * Method to read template view
     * 
     * @param string $path -> path to template file
     * @param array $data
     * @return string html
     */
    public static function reader($path, $data = array()) {
        ob_start();
        if(!empty($data)){
            extract($data);
        }
        include $path;
        return ob_get_clean();
    }

}

?>
